package com.honghe.system.service.impl;

import java.util.List;
import com.honghe.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.honghe.system.mapper.RiskEntrustBusinessMapper;
import com.honghe.system.domain.RiskEntrustBusiness;
import com.honghe.system.service.IRiskEntrustBusinessService;

/**
 * 风险委托Service业务层处理
 * 
 * @author xjw
 * @date 2025-04-22
 */
@Service
public class RiskEntrustBusinessServiceImpl implements IRiskEntrustBusinessService 
{
    @Autowired
    private RiskEntrustBusinessMapper riskEntrustBusinessMapper;

    /**
     * 查询风险委托
     * 
     * @param id 风险委托主键
     * @return 风险委托
     */
    @Override
    public RiskEntrustBusiness selectRiskEntrustBusinessById(Long id)
    {
        return riskEntrustBusinessMapper.selectRiskEntrustBusinessById(id);
    }

    /**
     * 查询风险委托列表
     * 
     * @param riskEntrustBusiness 风险委托
     * @return 风险委托
     */
    @Override
    public List<RiskEntrustBusiness> selectRiskEntrustBusinessList(RiskEntrustBusiness riskEntrustBusiness)
    {
        return riskEntrustBusinessMapper.selectRiskEntrustBusinessList(riskEntrustBusiness);
    }

    /**
     * 新增风险委托
     * 
     * @param riskEntrustBusiness 风险委托
     * @return 结果
     */
    @Override
    public int insertRiskEntrustBusiness(RiskEntrustBusiness riskEntrustBusiness)
    {
        riskEntrustBusiness.setCreateTime(DateUtils.getNowDate());
        return riskEntrustBusinessMapper.insertRiskEntrustBusiness(riskEntrustBusiness);
    }

    /**
     * 修改风险委托
     * 
     * @param riskEntrustBusiness 风险委托
     * @return 结果
     */
    @Override
    public int updateRiskEntrustBusiness(RiskEntrustBusiness riskEntrustBusiness)
    {
        riskEntrustBusiness.setUpdateTime(DateUtils.getNowDate());
        return riskEntrustBusinessMapper.updateRiskEntrustBusiness(riskEntrustBusiness);
    }

    /**
     * 批量删除风险委托
     * 
     * @param ids 需要删除的风险委托主键
     * @return 结果
     */
    @Override
    public int deleteRiskEntrustBusinessByIds(Long[] ids)
    {
        return riskEntrustBusinessMapper.deleteRiskEntrustBusinessByIds(ids);
    }

    /**
     * 删除风险委托信息
     * 
     * @param id 风险委托主键
     * @return 结果
     */
    @Override
    public int deleteRiskEntrustBusinessById(Long id)
    {
        return riskEntrustBusinessMapper.deleteRiskEntrustBusinessById(id);
    }
}
